package main

/*
#include <stdio.h>
#include <stdlib.h>
void hello(){
	printf("Hello,Cgo!...From C World.\n");
}
void print(char *str){
	printf("%s\n",str);
}
*/
import "C"

import (
	"unsafe"
)

func Hello() {
	C.hello()
}
func main() {
	Hello()
	s := "Hello Cgo!"
	cs := C.CString(s)         //类型转换，将golang的string类型转换成C语言的字符数组类型
	C.print(cs)                //函数调用
	C.free(unsafe.Pointer(cs)) //内存释放
}
